Method for rendering of simulating illumination and terminal

ABSTRACT

Embodiments of this application disclose a method for rendering of simulating illumination performed at a terminal, including: obtaining first grid vertex information of a preset first virtual object model, the first grid vertex information including first color information and first normal information, the first normal information being obtained by baking a high model corresponding to the preset first virtual object model; performing vertex space conversion on the first normal information to obtain second normal information corresponding to the first grid vertex information; obtaining first illumination information corresponding to the first grid vertex information according to a preset color setting rule and the second normal information, the preset color setting rule being used to represent a correspondence between colors and illumination; and rendering the first virtual object model by using the first illumination information, the first color information, and the first grid vertex information to obtain a second virtual object model.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of PCT/CN2018/093322,entitled “METHOD FOR RENDERING OF SIMULATING ILLUMINATION AND TERMINAL”filed on Jun. 28, 2018, which claims priority to Chinese PatentApplication No. 201710711285.3, entitled “METHOD FOR RENDERING OFSIMULATING ILLUMINATION AND TERMINAL” filed with the Chinese PatentOffice on Aug. 18, 2017, both of which are incorporated by reference intheir entirety.

FIELD OF THE TECHNOLOGY

This application relates to modeling technology in the field ofelectronic application, and in particular, to rendering of simulatingillumination.

BACKGROUND OF THE DISCLOSURE

With continuous development of science and technology, electronictechnology also develops rapidly. There are more types of electronicproducts, and people also enjoy various convenience brought by thedevelopment of science and technology. Nowadays, people may enjoy acomfortable life brought by the development of science and technology byusing various types of electronic devices or terminals, and applicationswith various functions installed on the terminals (applicationterminals).

Currently, a user character or an image is simulated by using a virtualobject (such as a three-dimensional virtual character) in a socialapplication or a game application, and the simulated image is vivid. Aterminal (a development terminal) usually generates a three-dimensionalvirtual object by using a Unity development tool. First, the terminal(the development terminal) may obtain a design model from a model designtool, and import the design model into the Unity development tool toprocess a three-dimensional scene and a three-dimensional virtualobject. A usually used model design tool is Cinema 4D. However, theCinema 4D has a poor compatibility with the Unity, that is, the modeldesign tool provides a design model with a relatively good ambient lighteffect, but the Unity development tool does not provide such goodambient light, and therefore a poor effect is produced by importing thedesign model into the Unity.

In this case, a usual solution is to simulate the ambient light effectof the design tool by using a combination of multiple lights in theUnity, but the ambient light simulated by using the combination ofmultiple lights causes a significant reduction of performance andflexibility of the design model, and when a three-dimensional virtualcharacter moves, an illumination effect cannot be controlled due to thata light combination model is unchangeable, resulting in a poor displayeffect of the three-dimensional virtual object or character.

SUMMARY

In order to resolve the foregoing technical problems, embodiments ofthis application provide a method for rendering of simulatingillumination and a terminal, capable of simulating ambient light closeto that of real environment on the basis of guaranteeing shadow detailsof a three-dimensional design model, and processing a three-dimensionalvirtual object model by using the simulated ambient light, so that adisplay effect of the three-dimensional virtual object model or avirtual figure model is improved.

The technical solutions in this application are implemented as follows:

An embodiment of this application provides a method for rendering ofsimulating illumination performed at a terminal having one or moreprocessors and memory storing a plurality of programs to be executed bythe one or more processors, including:

obtaining, by the terminal, first grid vertex information of a presetfirst virtual object model, the first grid vertex information includingfirst color information and first normal information, and the firstnormal information being obtained by baking a high-precision modelcorresponding to the preset first virtual object model;

performing, by the terminal, vertex space conversion on the first normalinformation to obtain second normal information corresponding to thefirst grid vertex information;

obtaining, by the terminal, first illumination information correspondingto the first grid vertex information according to a preset color settingrule and the second normal information, the preset color setting rulebeing used to represent a correspondence between colors andillumination; and

rendering, by the terminal, the first virtual object model by using thefirst illumination information, the first color information, and thefirst grid vertex information to obtain a second virtual object model.

An embodiment of this application provides a terminal comprising one ormore processors, memory coupled to the one or more processors and aplurality of programs stored in the memory that, when executed by theone or more processors, cause the computing device to perform theaforementioned method for rendering of simulating illumination.

An embodiment of this application provides a non-transitory computerreadable storage medium, applied to a terminal, the computer readablestorage medium storing one or more programs for rendering of simulatingillumination, the one or more programs for rendering of simulatingillumination being executable by one or more processors to implement theforegoing method for rendering of simulating illumination.

Embodiments of this application provide a method for rendering ofsimulating illumination and a terminal, including obtaining first gridvertex information of a preset first virtual object model, first colorinformation corresponding to the first grid vertex information, andfirst normal information, the preset first virtual object model being apreset model to be processed, and the first normal information beingobtained by baking a high-precision model corresponding to the presetfirst virtual object model; performing vertex space conversion on thefirst normal information to obtain second normal informationcorresponding to the first grid vertex information; obtaining firstillumination information corresponding to the first grid vertexinformation according to a preset color setting rule and the secondnormal information, the preset color setting rule being used torepresent a correspondence between colors and illumination; andrendering the first virtual object model by using the first illuminationinformation, the first color information, and the first grid vertexinformation to obtain a second virtual object model. By using theforegoing technical solutions, the terminal may parse illuminationinformation corresponding to each grid vertex according to refinednormal information determined by the high-precision model and may thususe the illumination information as ambient light to render the firstvirtual object model. Because the normal information has a very highprecision, shadow details of a three-dimensional design model areguaranteed, and the ambient light close to that of a real environment issimulated, a display effect of the rendered second virtual object modelhas a very high precision, so that the display effect of the secondvirtual object model is improved.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is flowchart 1 of a method for rendering of simulatingillumination according to an embodiment of this application;

FIG. 2 is a schematic diagram of an effect of an exemplary normal mapaccording to an embodiment of this application;

FIG. 3 is flowchart 2 of a method for rendering of simulatingillumination according to an embodiment of this application;

FIG. 4 is a diagram of an exemplary normal map making interfaceaccording to an embodiment of this application;

FIG. 5 is a schematic flat pattern of an exemplary model according to anembodiment of this application;

FIG. 6 is a schematic diagram of an exemplary normal map according to anembodiment of this application;

FIG. 7 is a schematic diagram of an exemplary rendering effect accordingto an embodiment of this application;

FIG. 8 is schematic structural diagram 1 of a terminal according to anembodiment of this application;

FIG. 9 is schematic structural diagram 2 of a terminal according to anembodiment of this application;

FIG. 10 is schematic structural diagram 3 of a terminal according to anembodiment of this application; and

FIG. 11 is schematic structural diagram 4 of a terminal according to anembodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following clearly and completely describes the technical solutionsin the embodiments of this application with reference to theaccompanying drawings in the embodiments of this application.

A method for rendering of simulating illumination provided in theembodiments of this application may be applied to any applications orfunctions using a three-dimensional model, and an application terminalmay be installed with the foregoing application and implement acorresponding function by performing data interaction with a servercorresponding to the application.

In the embodiments of this application, a method for rendering used by aterminal (a development terminal) when the terminal processes athree-dimensional model, to achieve a process of well displaying thethree-dimensional model is mainly described.

Embodiment 1

An embodiment of this application provides a method for rendering ofsimulating illumination. As shown in FIG. 1, the method may include thefollowing steps:

S101: Obtain first grid vertex information of a preset first virtualobject model, first color information corresponding to the first gridvertex information, and first normal information, the preset firstvirtual object model being a preset model to be processed, and the firstnormal information being obtained by baking by a high-precision modelcorresponding to the preset first virtual object model.

In the embodiment of this application, when processing athree-dimensional model, a terminal may first establish a model by usinga three-dimensional model design tool and then further process the modelby using a three-dimensional model development tool, to finally obtainthe three-dimensional model.

In the embodiment of this application, the three-dimensional modeldesign tool may be 3ds Max, ZByush, Cinema 4D, or the like. Theembodiment of this application is not limited a type of the model designtool. In addition, the three-dimensional model development tool may beUnity 3D, Unreal, or the like. The embodiment of this application is notlimited to a type of the model development tool. In a possibleimplementation of the embodiment of this application, thethree-dimensional model design tool is Cinema 4D, and thethree-dimensional model development tool is Unity 3D.

The terminal establishes a needed three-dimensional virtual object modelin the three-dimensional design tool and after the three-dimensionalvirtual object model is established, exports the three-dimensionalvirtual object model, for further model processing by thethree-dimensional model development tool.

The embodiment of this application mainly describes the process ofrendering the three-dimensional virtual object model in thethree-dimensional model development tool after the three-dimensionalvirtual object model is established.

In the embodiment of this application, the terminal establishes avirtual object according to a requirement of application development.The terminal may establish a low model with low precision, that is, apreset first virtual object model, and a high-precision model with highprecision, that is, a preset third virtual object model for the samevirtual object. In other words, the preset first virtual object modeland the preset third virtual object model are both models establishedfor the same virtual object with a difference in the precision ofmodeling.

In this way, the terminal may obtain relevant information of the presetfirst virtual object model and the preset third virtual object model.Therefore, the terminal may generate a normal map according to thepreset third virtual object model. A method for making a normal map maybe high-precision model baking. Simply, by first making a high-precisionmodel with millions of faces or tens of millions of faces or evenhundreds of millions of faces (that is, the preset third virtual objectmodel), then making a low-precision model with thousands of faces ortens of thousands of faces (that is, the preset first virtual objectmodel), and then baking detail information of the high-precision modelon the low model, a normal map is obtained. The three-dimensional modelin the terminal approximately simulates an object by using a combinationof a plurality of polygon faces and it is not smooth. A larger quantityof faces indicates a closer relationship of the three-dimensional modelto a real object. In this way, when one point of a face is exposed tolight, a normal is obtained by using interpolation through severalvertices of the face. Actually, the interpolation is also to simulate a“correct” normal direction of the point. Otherwise, if normals of allpoints of the entire face are consistent, the model obtained whenexposed to light, in an exaggerated way, is like mirrors spliced to eachother.

On the basis of the foregoing implementation, the three-dimensionaldevelopment tool of the terminal may parse the preset first virtualobject model, obtain the first grid vertex information of the presetfirst virtual object model, and the first color informationcorresponding to the first grid vertex information, and also parse thenormal map to obtain the first normal information. The first virtualobject model is the preset model to be processed, and the first normalinformation is obtained by baking the high-precision model (that is, thepreset third virtual object model) corresponding to the preset firstvirtual object model.

In this case, a UV map and a diffuse map of the preset first virtualobject model can be obtained from the preset first virtual object modelobtained by the terminal. Therefore, the terminal parses the UV map toobtain the first grid vertex information of the preset first virtualobject model, and the terminal parses the diffuse map to obtain vertexcolor information of the preset first virtual object model, that is, thefirst color information.

In the embodiment of this application, the three-dimensional model isestablished by using different tangent planes. Therefore, there aremultiple vertices in the preset first virtual object model, and thefirst grid vertex information is coordinate information of each gridvertex of the preset first virtual object model.

S102: Perform vertex space conversion on the first normal information toobtain second normal information corresponding to the first grid vertexinformation.

The first normal information obtained by the terminal is normalinformation related to an object space, and the terminal needs toguarantee that an illumination direction and normal information are inthe same coordinate system during rendering. Further, the illuminationdirection is usually in a world space while the normal information is inan object space. Therefore, after the terminal obtains the first gridvertex information of the preset first virtual object model, the firstcolor information corresponding to the first grid vertex information,and the first normal information, the terminal needs to perform thevertex space conversion on the first normal information by the terminalto meet a requirement of rendering and finally obtain the second normalinformation corresponding to the first grid vertex information.

In the embodiment of this application, each grid vertex may correspondto normal information (collectively referred to as the first normalinformation), and vertex information of each grid vertex is collectivelyreferred to as the first grid vertex information. Therefore, the firstgrid vertex information of the preset first virtual object modelcorresponds to the first normal information.

In the embodiment of this application, the second normal information inthe world space is obtained after the terminal performs the vertex spaceconversion on the first normal information.

The normal is a line perpendicular to a plane. An angle between lightand the plane can be known by calculating an angle between the light andthe normal, and color information to be obtained by the plane can befurther obtained through calculation. The embodiment of this applicationprocesses the simulating illumination by using the principle. The firstnormal information corresponding to each grid vertex is stored at acorresponding pixel point on the normal map, and thus in the normal map,by storing the normal of each pixel point on a texture, a darknessdegree of each pixel point can be determined according to the normal ofthe pixel point during rendering. That is, the first normal informationrecords value details of highlights and shadows of each vertexinformation, and the first normal information is stored on the normalmap as three colors, RGB (red, green, and blue).

In this case, one normal is a three-dimensional vector composed of threecomponents X, Y and Z. Therefore, the three components are stored asvalues of the three colors, red, green, and blue, to generate a new map,that is, the normal map. In the normal map, a red channel and a greenchannel represent an offset of up, down, left, and right, and a bluechannel represents a vertical offset.

It is to be understood that the terminal regards a pixel point on thenormal map as a normal, and a size of the normal map is 512*512 pixels,that is, 262,144 pixels. In this case, if the normal map is adhered tothe preset first virtual object model, it is equivalent to that thereare 262,144 normals on the preset first virtual object model (certainly,it is not this case in reality), such that the preset first virtualobject model with hundreds of faces immediately presents a detail effectof being with hundreds of thousands of faces.

S103: Obtain first illumination information corresponding to the firstgrid vertex information according to a preset color setting rule and thesecond normal information, the preset color setting rule being used torepresent a correspondence between colors and illumination.

The terminal performs the vertex space conversion on the first normalinformation. After the second normal information corresponding to thefirst grid vertex information is obtained, the terminal can obtain thefirst illumination information corresponding to the first grid vertexinformation according to the preset color setting rule and the secondnormal information since the second normal information is in one-to-onecorrespondence to the first grid vertex information. That is, theterminal performs projection on a positive plane based on a normalcorresponding to the second normal information, and therefore aprojection point of the normal can be converted into UV coordinates(corresponding to the first grid vertex information) of the normal map.In this case, the terminal may set a color for each grid vertexcorresponding to the UV coordinates according to the preset colorsetting rule to obtain the first illumination information, where thepreset color setting rule is used to represent the correspondencebetween colors and illumination.

In this case, the terminal may store, according to the second normalinformation and the preset color setting rule, color information on eachgrid vertex of the first grid vertex information to obtain the secondcolor information of the first grid vertex information and use thesecond color information as the first illumination information.

In the embodiment of this application, when normals in all directionsare projected on a positive plane, a projection range is within x (−1,1)and y (−1,1), forming a circle. Therefore, a valid range of the normalmap is substantially a circle. In this way, when making an illuminationmap by obtaining the first illumination information based on the secondnormal information, an area for storing the first illuminationinformation in the illumination map is a circle.

In the embodiment of this application, the illumination map may be amaterial capture (MatCap) map, and displaying of an object of areflective material and having a uniformly colored surface isimplemented by using a Matcap map of a ball of specific material as aview-space environment map of the current material. Based on a shader ofa MatCap idea, the terminal may not need to provide any illumination,but only to provide one or more suitable MatCap maps as “guidance” of anillumination result.

The shader in the embodiment of this application is a tool for renderinga three-dimensional model.

In the embodiment of this application, the preset color setting rule isbased on a principle: black absorbs less light, while white absorbs morelight. Therefore, when a grid vertex is exposed to strong light, thesecond color information set for the grid vertex is adjusted to be lightand when a grid vertex is exposed to weak light, the disposed secondcolor information set for the grid vertex is adjusted to be dark. Inthis way, the terminal can obtain the first illumination informationusing the second color information to represent illumination.

The color information may be selected from 0 to 255. A value closer to 0indicates a darker color and a value closer to 255 indicates a lightercolor. That is, if light at a circular center area of the illuminationmap is strong, the second color information is relatively light, and iflight at an edge is weak, the second color information is relativelydark.

S104: Render the first virtual object model by using the firstillumination information, the first color information, and the firstgrid vertex information to obtain a second virtual object model.

After the terminal obtains the first illumination informationcorresponding to the first grid vertex information according to thepreset color setting rule and the second normal information, because theterminal is capable of using the first illumination information tosimulate ambient light and the first illumination information isobtained by using the related normal information and integrated withhigh-precision illumination and shadow details, the ambient light isclose to real ambient light. In this way, the terminal may render thefirst virtual object model according to the first illuminationinformation, the first color information, and the first grid vertexinformation to obtain the second virtual object model.

In the embodiment of this application, the terminal may fill a vertexcolor of each grid vertex corresponding to the first grid vertexinformation by using the first illumination information and the firstcolor information, to obtain main vertex color information of vertices,so as to use the main vertex color information to process the presetfirst virtual object model.

Further, in the embodiment of this application, rendering of the presetfirst virtual object model by the terminal may be processing on allaspects including a texture and a color. This is not limited in theembodiment of this application.

In the embodiment of this application, the normal map is establishedbased on UVs of a model and may record detail values of highlights andshadows, and in this case, after the terminal obtains the normal map andapplies the normal map onto the preset first virtual object model, theprecision of the obtained second virtual object model is relatively highand concave-convex performance of a surface texture can be wellreflected.

For example, the preset first virtual object model is assumed to be acandleholder model. As shown in FIG. 2, the left side shows acandleholder model, and after the normal map is applied onto thecandleholder model, the candleholder model changes into a shape as shownin the right side and appears to be strongly stereotypic.

That is, the terminal may use the normal map to process texture detailswhen rendering the three-dimensional model and generally the terminalimplements the processing by using a vertex shader.

Further, before S101, as shown in FIG. 3, a method for rendering ofsimulating illumination provided by the embodiment of this applicationmay further include: S105 to S107 as follows:

S105: Obtain second grid vertex information corresponding to a presetthird virtual object model, where the preset third virtual object modelis a high-precision model corresponding to a preset first virtual objectmodel.

S106: Obtain a first normal direction according to the second gridvertex information and a preset normal model.

S107: Determine first normal information corresponding to the firstnormal direction according to a preset correspondence between the secondgrid vertex information and a first grid vertex.

In the embodiment of this application, before implementing the renderingin the shader, the terminal first generates the normal map of thehigh-precision model that is the same as the simulated virtual object,so as to parse the first normal information from the normal map. Aprocess for obtaining the normal map by the terminal may be a method forbaking a high-precision model. That is, the terminal obtains the secondgrid vertex information corresponding to the high-precision model (thatis, the preset third virtual object model) corresponding to the presetfirst virtual object model, obtains the first normal direction accordingto the second grid vertex information and the preset normal model, andfinally determines the first normal information corresponding to thefirst normal direction according to the preset correspondence betweenthe second grid vertex information and the first grid vertex.

The introduction of the normal map is to provide data of illuminationand shadow details for a model with a small quantity of faces tosimulate a model with a large quantity of faces. In this case, asignificant factor is an included angle between a light incidentdirection and a normal of an incident point. The normal map essentiallyrecords related information of the included angle, and calculation ofillumination is relevant to a normal direction on a face.

In this case, the terminal may obtain the second grid vertex informationcorresponding to the preset third virtual object model (that is,information of each grid vertex in the preset third virtual objectmodel). When light irradiates on a point on a face of the preset thirdvirtual object, a first normal direction of the point is obtained byperforming interpolation on several grid vertices of the face (that isthe preset normal model); then, the terminal projects the preset thirdvirtual object model on the preset first virtual object model accordingto the preset correspondence between the second grid vertex informationand the first grid vertex, to form a two-dimensional projection (forexample, an x-y plane projection); therefore, the terminal obtains twoprojection directions of a first normal of each grid vertexcorresponding to the first grid vertex information on thetwo-dimensional projection; and finally, the terminal uses the obtainedfirst normal direction of each grid vertex as a z direction, so that thefirst normal information of each grid vertex is obtained. Then, theterminal stores the first normal information of each vertex to acorresponding pixel point on the normal map. In actual calculation,directions and sizes of x, y, and z in the first normal information areprojected onto a color space rgb. That is, a value of x is stored in r,a value of y is stored in g, and a value of z is stored in b. When theterminal renders the preset first virtual object model, the normal mapis obtained, and the terminal obtains the first normal information byparsing the normal map.

In a possible implementation, the normal map in the embodiment of thisapplication may be an object space normal map.

The normal map, when being made, may also be made into a normal map inanother space. This is not limited in the embodiment of thisapplication.

For example, in optimization of shadow control of a model using a normalmap by the terminal, if it is assumed that the preset third virtualobject model is a facial model, FIG. 4 shows a display window for makinga normal map of the facial model. The facial model is projected toobtain a planar expansion image shown in FIG. 5 by using a bakingmethod. Finally, the planar expansion image shown in FIG. 5 is stored inRGB values by the terminal to obtain a normal map shown in FIG. 6.

Further, before S105, a method for rendering of simulating illuminationprovided by the embodiment of this application further includes: S108 asfollows:

S108: Obtain a scene file, and establish a first scene according to thescene file.

Before the terminal renders the preset first virtual object model, theterminal needs to obtain the scene file of the three-dimensional modelto be established, to establish the first scene according to the scenefile, and then to present and process the preset first virtual objectmodel in the first scene.

The embodiment of this application is not limited to a type of the firstscene, and the scene may be all types of scenes including snow-coveredlandscape and desert.

In the embodiment of this application, S108 is of the first executiveorder of the terminal to start model processing. That is, S108 may beexecuted by the terminal before S105 to S107.

Further, after S104, on the basis of implementing S108, a method forrendering of simulating illumination provided by the embodiment of thisapplication may further include: S109 as follows:

S109: Display the second virtual object model in the first scene.

After the terminal obtains the rendered second virtual object model,because the second virtual object model is a model that has beenrendered and drawn and the entire model is processed in the first scene,in this way, the terminal may display or present the second virtualobject model in the first scene.

Embodiment 2

In a method for rendering of simulating illumination provided by theembodiment of this application, the method for performing vertex spaceconversion on the first normal information to obtain second normalinformation corresponding to the first grid vertex information in S102may include: S1021 and S1022 as follows:

S1021: Perform the vertex space conversion on the first normalinformation to convert the first normal information into a tangentspace, to obtain third normal information.

S1022: Normalize the third normal information to obtain second normalinformation.

In the embodiment of this application, the terminal needs to use theMatCap map, to mainly convert the first normal information from anobject space into a tangent space and to transfer the first normalinformation to an area [0,1] suitable for extracting a texture UV.

In a process for generating a normal map, the tangent space used by thehigh-precision model (the preset third virtual object model) is on thelow model (the preset first virtual object model). The terminal, whengenerating the normal map, may certainly determine which faces on thehigh-precision model correspond to which face on the low model, and thennormals of the faces on the high-precision model are converted intocoordinates of the constructed tangent space on the face of the lowmodel. In this way, when the low model deforms, that is, when a triangleface changes, the tangent space of the low model also changes. Externalcoordinates can be obtained by multiplying normal information (that is,a normal value) stored in the normal map by a conversion matrix from thetangent space of the face of the low model to an external coordinatesystem, where the first normal information stored in the high-precisionmodel corresponds to a normal in the object space on the high-precisionmodel.

In this case, a specific implementation for the terminal to perform thevertex space conversion on the first normal information to convert thefirst normal information into the tangent space is as follows: For eachgrid vertex corresponding to the first grid vertex information, amodel-view matrix may be used to convert from the object space into thetangent space. However, if the model-view matrix is used to convert anormal vector of the first normal information from the object space intoan eye space, in the eye space, a direction of tangent conforms to adefinition, but the normal is not perpendicular to a tangent of the gridvertex. Therefore, the model-view matrix is not suitable for the normal.Because in a case in which T is assumed to be the tangent, MV is themodel-view matrix, and P1 and P2 are two grid vertices associated by thetangent,T=P2−P1  (1)T′=T*MV=(P2−P1)*MV=P2*MV−P1*MV=P2′−P1′  (2).

Therefore, it can be learned from the formulas (1) and (2) that thedefinition to the tangent is retained in T′ and for the normal, N=Q2−Q1may further be found to represent the normal. However, after theconversion, Q2′−Q1′ cannot be ensured to be perpendicular to T′.Therefore, an angle relationship between the object space and the viewspace is changed. For calculation of the conversion of the normal tomaintain that the normal is perpendicular to the tangent, it is assumedthat the normal matrix is G, since the normal is perpendicular to thetangent, a formula (3) can be derived:N′·T′=(GN)·(MT)=0  (3)

After converting a dot product of the formula (3) to a cross product, aformula (4) is obtained:(GN)·(MT)=(GN)T*(MT)=(GN)T(MT)=(NTGT)(MT)=NTGTMT=0  (4),

where NTT is 0.

If GTM=I, the formula (4) is established, and therefore G=(M−1)T.

That is, the normal matrix is a transposed matrix of an inverse matrixof the model-view matrix.

In this case, the first normal information can be converted into thetangent space from the object space using the normal matrix, so that thethird normal information is obtained.

For example, descriptions are provided by using an example of the Unity.A built-in conversion matrix, a normal matrix, of the Unity may beindicated by:

-   UNITY_MATRIX_IT_MV, which is an inverse transposed matrix of-   UNITY_MATRIX_MV (the model-view matrix), and a function of which is    to convert the first normal information from the object space to the    tangent space, to obtain the third normal information. The process    is implemented in a vertex shader, as follows:

//prepare MatCap coordinates: convert the normal from the object spaceto the tangent space and stored in the latter two texture coordinates zwof TEXCOORD1

output.diffuseUVAndMatCapCoords.z=dot(normalize(UNITY_MATRIX_IT_MV[0].xyz),normalize(input.normal));

output.diffuseUVAndMatCapCoords.w=dot(normalize(UNITY_MATRIX_IT_MV[1].xyz),normalize(input.normal)).

In the embodiment of this application, after converting the first normalinformation from the object space into the tangent space to obtain thethird normal information, the terminal further needs to convert thethird normal information to a range [0, 1] suitable for extracting thetexture UV to obtain the second normal information.

For example, descriptions are provided by using an example of the Unity.A process for normalizing the third normal information by the terminalto obtain the second normal information is implemented in the vertexshader, as follows:

//normalize.normal value range [−1, 1] to convert the range into a range[0, 1] suitable for the texture

output.diffuseUVAndMatCapCoords.zw=output.diffuseUVAndMatCapCoords.zw*0.5+0.5.

The range corresponding to the obtained third normal information in thetangent space after the space conversion by the terminal is [−1, 1], andif the range needs to be converted into the range [0, 1] for extractingthe texture UV, the range is multiplied by 0.5 and plus 0.5.

Further, the second normal information finally obtained by the terminalis exemplarily as follows:

//coordinates conversion

output.position=mul(UNITY_MATRIX_MVP, input. position);

//prepare a detail texture UV, stored in the first two coordinates xy ofTEXCOORD0

output.detailUVCoordsAndDepth.xy=TRANSFORM_TEX(input.UVCoordsChannel1,_DetailTex);

//prepare an in-depth information, stored in the third coordinate z ofTEXCOORD0

output.detailUVCoordsAndDepth.z=output.position.z.

In a method for rendering of simulating illumination provided by theembodiment of this application, the method of rendering the firstvirtual object model by using the first illumination information, thefirst color information, and the first grid vertex information to obtainthe second virtual object model in S104 may include: S1041 and S1042 asfollows:

S1041: Perform interpolation on the first color information and thesecond color information corresponding to the first grid vertexinformation to obtain main vertex color information of each grid vertexcorresponding to the first grid vertex information.

S1042: Draw according to a correspondence between the main vertex colorinformation and each grid vertex to obtain the second virtual objectmodel.

In the embodiment of this application, a main vertex color correspondingto each grid vertex in the preset first virtual object model of theterminal is the first color information and the terminal uses anillumination map to render the preset first virtual object model. Inthis way, the terminal performs interpolation on the first colorinformation and the second color information corresponding to the firstgrid vertex information to obtain the main vertex color information ofeach grid vertex corresponding to the first grid vertex information; andthen, the terminal draws according to the correspondence between themain vertex color information and each grid vertex to obtain the secondvirtual object model.

The first color information in the embodiment of this application may beoriginal main vertex color information and the terminal may obtain adetail texture according to the second normal information in the normalmap, so as to obtain detail color information.

For example, a process for obtaining the detail color information by theterminal is as follows:

//detail texture

float 3detailMask=tex2D(_DetailTex,

input.detailUVCoordsAndDepth.xy).rgb;

//detail color information

float 3detailColor=lerp(_DetailColor.rgb, mainColor, detailMask).

In the embodiment of this application, first, the terminal may firstperform interpolation on the detail color and the first colorinformation, which is referred to as new main vertex color information,and then interact the new main vertex color information with the secondcolor information (the first illumination information) extracted fromthe illumination map to obtain final main vertex color information. Forexample, as follows:

//perform interpolation on the detail color and the main vertex color toobtain new main vertex color information

mainColor=lerp(detailColor, mainColor,

saturate(input.detailUVCoordsAndDepth.z*DetailTexDepthOffset));

//extract the corresponding first illumination information from theprovided MatCap map (a parsing process)

float3matCapColor=tex2D(MatCap,input.diffuseUVAndMatCapCoords.zw). rgb;

//final main vertex color information

float4finalColor=float4(mainColor*matCapColor*2.0,MainColor.a).

In the embodiment of this application, the rendering of the preset firstvirtual object model by the terminal is rendering performed by combiningthe original model, the normal map, and the MatCap map, to obtainsimulated ambient light and guarantee a correspondence between each gridvertex and the color information output by shadow details (thecorrespondence between the main vertex color information and each gridvertex). The terminal draws according to the correspondence between eachgrid vertex and the color information to obtain the second virtualobject model.

For example, compared with a three-dimensional character model, as shownin FIG. 7, an effect of the three-dimensional character modelimplemented in the method for rendering used in the embodiment of thisapplication is as shown in a model 1 of FIG. 7 and an effect of thethree-dimensional character model implemented in the previous method forrendering is as shown in a model 2 of FIG. 7. Upon comparison, it can belearned that the precision of the presenting effect of the model 1 ismuch higher than that of the model 2 and the presenting effect of thesecond virtual object model is improved.

Further, in the embodiment of this application, using athree-dimensional character model scene as an example, a result of usingthe rendered three-dimensional virtual character model in the embodimentof this application is to weaken a trace of a connecting seam by usingambient light coordinated with the normal map at a similar connectingpart between a head and a body, mainly aligning shadows at theconnecting seam of the normal map. When the Matcap similar to the headand the body part simulates the ambient light, an amount of light keepsconsistent at a coordinate point location of the connecting seam, toavoid a relatively obvious trace in cases of different amounts of lightat the connecting seam. That is, the point rendering at the connectingseam of parts or tangent planes is weakened aiming at each block of thethree-dimensional character model.

Embodiment 3

Based on the same inventive concept of Embodiment 1 and Embodiment 2, asshown in FIG. 8, an embodiment of this application provides a terminal1. The terminal 1 may include:

an obtaining unit 10, configured to obtain first grid vertex informationof a preset first virtual object model, first color informationcorresponding to first grid vertex information, and first normalinformation, the preset first virtual object model being a preset modelto be processed, and the first normal information being obtained bybaking a high-precision model corresponding to the preset first virtualobject model;

a conversion unit 11, configured to perform vertex space conversion onthe first normal information to obtain second normal informationcorresponding to the first grid vertex information;

the obtaining unit 10 further being configured to obtain firstillumination information corresponding to the first grid vertexinformation according to a preset color setting rule and the secondnormal information, the preset color setting rule being used torepresent a correspondence between colors and illumination; and

a rendering unit 12, further configured to render the first virtualobject model by using the first illumination information, the firstcolor information, and the first grid vertex information to obtain asecond virtual object model.

In a possible implementation, the conversion unit 11 is specificallyconfigured to perform the vertex space conversion on the first normalinformation to convert the first normal information into a tangentspace, to obtain third normal information; and normalize the thirdnormal information to obtain the second normal information.

In a possible implementation, the obtaining unit 10 is specificallyconfigured to store, according to the second normal information and thepreset color setting rule, color information on each grid vertex of thefirst grid vertex information to obtain second color information of thefirst grid vertex information and use the second color information asthe first illumination information.

In a possible implementation, the rendering unit 12 is specificallyconfigured to perform interpolation on the first color information andthe second color information corresponding to the first grid vertexinformation to obtain main vertex color information of each grid vertexcorresponding to the first grid vertex information; and draw accordingto a correspondence between the main vertex color information and eachgrid vertex to obtain the second virtual object model.

In a possible implementation, the obtaining unit 10 is furtherconfigured to: before the obtaining first grid vertex information of apreset first virtual object model, first color information correspondingto the first grid vertex information, and first normal information,obtain second grid vertex information corresponding to a preset thirdvirtual object model, the preset third virtual object model being ahigh-precision model corresponding to the preset first virtual objectmodel; obtain a first normal direction according to the second gridvertex information and a preset normal model; and determine the firstnormal information corresponding to the first normal direction accordingto a preset correspondence between the second grid vertex informationand a first grid vertex.

In a possible implementation, based on FIG. 8, as shown in FIG. 9, theterminal 1 further includes: an establishment unit 13.

The obtaining unit 10 is further configured to: before the obtainingfirst grid vertex information of a preset first virtual object model,first color information corresponding to the first grid vertexinformation, and first normal information, obtain a scene file.

The establishment unit 13 is configured to establish a first sceneaccording to the scene file.

In a possible implementation, based on FIG. 9, as shown in FIG. 10, theterminal 1 further includes: a display unit 14.

The display unit 14 is configured to: after the drawing according to acorrespondence between the main vertex color information and each gridvertex to obtain the second virtual object model, display the secondvirtual object model in the first scene.

It is to be understood that the terminal may parse illuminationinformation corresponding to each grid vertex according to refinednormal information determined by the high-precision model and may thususe the illumination information as ambient light to render the firstvirtual object model. Because the normal information has a very highprecision, shadow details of a three-dimensional design model areguaranteed, and the ambient light closed to that of a real environmentis simulated, a display effect of the rendered second virtual objectmodel has a very high precision, so that the display effect of thesecond virtual object model is improved.

Embodiment 4

Based on the same inventive concept of Embodiment 1 and Embodiment 2, asshown in FIG. 11, an embodiment of this application provides a terminal.The terminal may include:

a processor 15, a memory 16, a display 17, and a communications bus 18,where the processor 15, the memory 16, and the display 17 are connectedthrough the communications bus 18.

The processor 15 is configured to invoke a related rendering program ofsimulating illumination stored by the memory 16, and perform thefollowing operations:

obtaining first grid vertex information of a preset first virtual objectmodel, first color information corresponding to first grid vertexinformation, and first normal information, the preset first virtualobject model being a preset model to be processed, and the first normalinformation being obtained by baking a high-precision modelcorresponding to the preset first virtual object model; performingvertex space conversion on the first normal information to obtain secondnormal information corresponding to the first grid vertex information;obtaining first illumination information corresponding to the first gridvertex information according to a preset color setting rule and thesecond normal information, the preset color setting rule being used torepresent a correspondence between colors and illumination; andrendering the first virtual object model by using the first illuminationinformation, the first color information, and the first grid vertexinformation to obtain a second virtual object model.

The display 17 is configured to display the second virtual object model.

Optionally, the processor 15 is specifically configured to performvertex space conversion on the first normal information to convert thefirst normal information into a tangent space, to obtain third normalinformation; and normalize the third normal information to obtain thesecond normal information.

Optionally, the processor 15 is specifically configured to store,according to the second normal information and the preset color settingrule, color information on each grid vertex of the first grid vertexinformation to obtain second color information of the first grid vertexinformation and use the second color information as the firstillumination information.

Optionally, the processor 15 is specifically configured to performinterpolation on the first color information and the second colorinformation corresponding to the first grid vertex information to obtainmain vertex color information of each grid vertex corresponding to thefirst grid vertex information; and draw according to a correspondencebetween the main vertex color information and each grid vertex to obtainthe second virtual object model.

Optionally, the processor 15 is further configured to: before theobtaining first grid vertex information of a preset first virtual objectmodel, first color information corresponding to the first grid vertexinformation, and first normal information, obtain second grid vertexinformation corresponding to a preset third virtual object model, thepreset third virtual object model being a high-precision modelcorresponding to the preset first virtual object model; obtain a firstnormal direction according to the second grid vertex information and apreset normal model; and determine the first normal informationcorresponding to the first normal direction according to a presetcorrespondence between the second grid vertex information and a firstgrid vertex.

Optionally, the processor 15 is further configured to: before theobtaining first grid vertex information of a preset first virtual objectmodel, first color information corresponding to the first grid vertexinformation, and first normal information, obtain a scene file; andestablish a first scene according to the scene file.

Optionally, the display 17 is configured to: after the drawing accordingto a correspondence between the main vertex color information and eachgrid vertex to obtain the second virtual object model, display thesecond virtual object model in the first scene.

It is to be understood that the terminal may parse illuminationinformation corresponding to each grid vertex according to refinednormal information determined by the high-precision model and may thususe the illumination information as ambient light to render the firstvirtual object model. Because the normal information has a very highprecision, shadow details of a three-dimensional design model areguaranteed, and the ambient light closed to that of a real environmentis simulated, a display effect of the rendered second virtual objectmodel has a very high precision, so that the display effect of thesecond virtual object model is improved.

In actual application, the memory may be a volatile memory, such as arandom-access memory (RAM); or a non-volatile memory, for example aread-only memory (ROM), a flash memory (flash memory), a hard disk drive(HDD) or a solid-state drive (SSD), or a combination of the memories ofthe foregoing types, and provides an instruction and data for theprocessor.

The foregoing processor may be at least one of an application-specificintegrated circuit (ASIC), a digital signal processor (DSP), a digitalsignal processing device (DSPD), a programmable logic device (PLD), afield programmable gate array (FPGA), a central processing unit (CPU), acontroller, a microcontroller, and a microprocessor. It is to beunderstood that the electronic device implementing the function of theprocessor may alternatively be other cases. This is not limited in theembodiment of this application.

Embodiment 5

Functional modules in this embodiment may be integrated into oneprocessing unit, or each of the units may exist alone physically, or twoor more units are integrated into one unit. The integrated unit may beimplemented in the form of hardware, or may be implemented in the formof a software functional module.

When the integrated unit is implemented in the form of a softwarefunctional module rather than be sold or used as an independent product,the integrated unit can be stored in a computer readable storage medium.Based on such an understanding, the technical solutions of theembodiment essentially, or the part contributing to the existingtechnology, or all or a part of the technical solutions may beimplemented in a form of a software product. The computer softwareproduct is stored in a computer readable storage medium and includesseveral instructions for instructing one computer device (which may be apersonal computer, a server, a network device, or the like) or aprocessor to perform all or some of steps of the methods described inthis embodiment. The foregoing storage medium includes: any medium thatcan store program code, such as a USB flash drive, a removable harddisk, a read-only memory (ROM), a random access memory (RAM), a magneticdisk, or an optical disc.

A computer readable storage medium provided by the embodiment of thisapplication is applied in the terminal. The computer readable storagemedium stores one or more rendering programs of simulating illuminationand the one or more rendering programs of simulating illumination may beexecuted by one or more processors to implement the methods described inEmbodiment 1 and Embodiment 2.

It is to be understood by a person skilled in the art that theembodiments of this application may be provided as a method, a system,or a computer program product. Therefore, this application may use aform of a hardware embodiment, a software embodiment, or an embodimentcombining software and hardware. Moreover, this application may use aform of a computer program product implemented on one or more computeravailable storage media (including but not limited to a disk memory, anoptical memory, and the like) that include computer available programcode.

This application is described with reference to flowcharts and/or blockdiagrams of the method, the device (system), and the computer programproduct in the embodiments of this application. It is to be understoodthat computer program instructions may be used to implement each processand/or each block in the flowcharts and/or the block diagrams and acombination of a process and/or a block in the flowcharts and/or theblock diagrams. These computer program instructions may be provided fora general-purpose computer, a dedicated computer, an embedded processor,or a processor of any other programmable data processing device togenerate a machine, so that the instructions executed by a computer or aprocessor of any other programmable data processing device generate anapparatus for implementing a specific function in one or more processesin the flowcharts and/or in one or more blocks in the block diagrams.

These computer program instructions may also be stored in a computerreadable memory that can instruct the computer or any other programmabledata processing device to work in a specific manner, so that theinstructions stored in the computer readable memory generate an artifactthat includes an instruction apparatus. The instruction apparatusimplements a specific function in one or more processes in theflowcharts and/or in one or more blocks in the block diagrams.

These computer program instructions may also be loaded onto a computeror another programmable data processing device, so that a series ofoperations and steps are performed on the computer or anotherprogrammable device, thereby generating computer-implemented processing.Therefore, the instructions executed on the computer or the anotherprogrammable device provide steps for implementing a specific functionin one or more processes in the flowcharts and/or in one or more blocksin the block diagrams.

The above embodiments are merely provided for describing the technicalsolutions of the embodiments of this application, but not intended tolimit the technical solutions of the embodiments of this application. Itis to be understood by a person of ordinary skill in the art thatalthough the embodiments of this application have been described indetail with reference to the foregoing embodiments, modifications can bemade to the technical solutions described in the foregoing embodiments,or equivalent replacements can be made to some technical features in thetechnical solutions, as long as such modifications or replacements donot cause the essence of corresponding technical solutions to departfrom the spirit and scope of the technical solutions of the embodimentsof this application.

What is claimed is:
 1. A method for rendering of simulating illuminationperformed at a terminal having one or more processors and memory storinga plurality of programs to be executed by the one or more processors,comprising: baking, by the terminal, a high-precision modelcorresponding to a preset first virtual object model to obtain firstnormal information corresponding to each grid vertex of a plurality ofgrid vertices associated with the preset first virtual object model, thefirst normal information recording value details of highlights andshadows of the grid vertex; storing, by the terminal, the first normalinformation corresponding to each grid vertex at a corresponding pixelpoint on a normal map associated with the preset first virtual objectmodel; obtaining, by the terminal, first grid vertex information of thepreset first virtual object model, the first grid vertex informationincluding first color information and the first normal information ofeach grid vertex of the plurality of grid vertices associated with thepreset first virtual object model; performing, by the terminal, vertexspace conversion on the first normal information to obtain second normalinformation corresponding to the first grid vertex information;obtaining, by the terminal, first illumination information correspondingto the first grid vertex information according to a preset color settingrule and the second normal information, the preset color setting rulebeing used to represent a correspondence between colors andillumination; and rendering, by the terminal, the first virtual objectmodel by using the first illumination information, the first colorinformation, and the first grid vertex information to obtain a secondvirtual object model.
 2. The method according to claim 1, wherein theperforming, by the terminal, vertex space conversion on the first normalinformation to obtain second normal information corresponding to thefirst grid vertex information comprises: performing, by the terminal,the vertex space conversion on the first normal information to convertthe first normal information into a tangent space, to obtain thirdnormal information; and normalizing, by the terminal, the third normalinformation to obtain the second normal information.
 3. The methodaccording to claim 1, wherein the obtaining, by the terminal, firstillumination information corresponding to the first grid vertexinformation according to a preset color setting rule and the secondnormal information comprises: storing, by the terminal, according to thesecond normal information and the preset color setting rule, colorinformation on each grid vertex of the first grid vertex information toobtain second color information of the first grid vertex information andusing the second color information as the first illuminationinformation.
 4. The method according to claim 3, wherein the rendering,by the terminal, the first virtual object model by using the firstillumination information, the first color information, and the firstgrid vertex information to obtain a second virtual object modelcomprises: performing, by the terminal, interpolation on the first colorinformation and the second color information corresponding to the firstgrid vertex information to obtain main vertex color information of eachgrid vertex corresponding to the first grid vertex information; anddrawing, by the terminal, according to a correspondence between the mainvertex color information and each grid vertex to obtain the secondvirtual object model.
 5. The method according to claim 1, wherein themethod further comprises: before the obtaining, by the terminal, firstgrid vertex information of a preset first virtual object model:obtaining, by the terminal, second grid vertex information correspondingto the third virtual object model, the third virtual object model beingthe high-precision model corresponding to the preset first virtualobject model; obtaining, by the terminal, a first normal directionaccording to the second grid vertex information and a preset normalmodel; and determining, by the terminal, the first normal informationcorresponding to the first normal direction according to acorrespondence between the second grid vertex information and a firstgrid vertex.
 6. The method according to claim 1, wherein the methodfurther comprises: before the obtaining, by the terminal, first gridvertex information of a preset first virtual object model: obtaining, bythe terminal, a scene file and establishing a first scene according tothe scene file.
 7. The method according to claim 6, wherein the methodfurther comprises: after the drawing, by the terminal, according to acorrespondence between the main vertex color information and each gridvertex to obtain the second virtual object model, displaying, by theterminal, the second virtual object model in the first scene.
 8. Themethod according to claim 6, wherein the plurality of operations furthercomprise: after the drawing, by the terminal, according to acorrespondence between the main vertex color information and each gridvertex to obtain the second virtual object model, displaying, by theterminal, the second virtual object model in the first scene.
 9. Aterminal, comprising one or more processors, memory coupled to the oneor more processors and a plurality of programs stored in the memorythat, when executed by the one or more processors, cause the computingdevice to perform a plurality of operations comprising: baking, by theterminal, a high-precision model corresponding to a preset first virtualobject model to obtain first normal information corresponding to eachgrid vertex of a plurality of grid vertices associated with the presetfirst virtual object model, the first normal information recording valuedetails of highlights and shadows of the grid vertex; storing, by theterminal, the first normal information corresponding to each grid vertexat a corresponding pixel point on a normal map associated with thepreset first virtual object model; obtaining, by the terminal, firstgrid vertex information of the preset first virtual object model, thefirst grid vertex information including first color information andfirst normal information of each grid vertex of a plurality of gridvertices associated with the preset first virtual object model;performing, by the terminal, vertex space conversion on the first normalinformation to obtain second normal information corresponding to thefirst grid vertex information; obtaining, by the terminal, firstillumination information corresponding to the first grid vertexinformation according to a preset color setting rule and the secondnormal information, the preset color setting rule being used torepresent a correspondence between colors and illumination; andrendering, by the terminal, the first virtual object model by using thefirst illumination information, the first color information, and thefirst grid vertex information to obtain a second virtual object model.10. The terminal according to claim 9, wherein the performing, by theterminal, vertex space conversion on the first normal information toobtain second normal information corresponding to the first grid vertexinformation comprises: performing, by the terminal, the vertex spaceconversion on the first normal information to convert the first normalinformation into a tangent space, to obtain third normal information;and normalizing, by the terminal, the third normal information to obtainthe second normal information.
 11. The terminal according to claim 9,wherein the obtaining, by the terminal, first illumination informationcorresponding to the first grid vertex information according to a presetcolor setting rule and the second normal information comprises: storing,by the terminal, according to the second normal information and thepreset color setting rule, color information on each grid vertex of thefirst grid vertex information to obtain second color information of thefirst grid vertex information and using the second color information asthe first illumination information.
 12. The terminal according to claim11, wherein the rendering, by the terminal, the first virtual objectmodel by using the first illumination information, the first colorinformation, and the first grid vertex information to obtain a secondvirtual object model comprises: performing, by the terminal,interpolation on the first color information and the second colorinformation corresponding to the first grid vertex information to obtainmain vertex color information of each grid vertex corresponding to thefirst grid vertex information; and drawing, by the terminal, accordingto a correspondence between the main vertex color information and eachgrid vertex to obtain the second virtual object model.
 13. The terminalaccording to claim 9, wherein the plurality of operations furthercomprise: before the obtaining, by the terminal, first grid vertexinformation of a preset first virtual object model: obtaining, by theterminal, second grid vertex information corresponding to the thirdvirtual object model, the third virtual object model being thehigh-precision model corresponding to the preset first virtual objectmodel; obtaining, by the terminal, a first normal direction according tothe second grid vertex information and a preset normal model; anddetermining, by the terminal, the first normal information correspondingto the first normal direction according to a correspondence between thesecond grid vertex information and a first grid vertex.
 14. The terminalaccording to claim 9, wherein the plurality of operations furthercomprise: before the obtaining, by the terminal, first grid vertexinformation of a preset first virtual object model, obtaining, by theterminal, a scene file and establishing a first scene according to thescene file.
 15. A non-transitory computer readable storage mediumstoring a plurality of machine readable instructions in connection witha terminal having one or more processors, wherein the plurality ofmachine readable instructions, when executed by the one or moreprocessors, cause the terminal to perform a plurality of operationsincluding: baking, by the terminal, a high-precision model correspondingto a preset first virtual object model to obtain first normalinformation corresponding to each grid vertex of a plurality of gridvertices associated with the preset first virtual object model, thefirst normal information recording value details of highlights andshadows of the grid vertex; storing, by the terminal, the first normalinformation corresponding to each grid vertex at a corresponding pixelpoint on a normal map associated with the preset first virtual objectmodel; obtaining, by the terminal, first grid vertex information of thepreset first virtual object model, the first grid vertex informationincluding first color information and first normal information of eachgrid vertex of a plurality of grid vertices associated with the presetfirst virtual object model; performing, by the terminal, vertex spaceconversion on the first normal information to obtain second normalinformation corresponding to the first grid vertex information;obtaining, by the terminal, first illumination information correspondingto the first grid vertex information according to a preset color settingrule and the second normal information, the preset color setting rulebeing used to represent a correspondence between colors andillumination; and rendering, by the terminal, the first virtual objectmodel by using the first illumination information, the first colorinformation, and the first grid vertex information to obtain a secondvirtual object model.
 16. The non-transitory computer readable storagemedium according to claim 15, wherein the performing, by the terminal,vertex space conversion on the first normal information to obtain secondnormal information corresponding to the first grid vertex informationcomprises: performing, by the terminal, the vertex space conversion onthe first normal information to convert the first normal informationinto a tangent space, to obtain third normal information; andnormalizing, by the terminal, the third normal information to obtain thesecond normal information.
 17. The non-transitory computer readablestorage medium according to claim 15, wherein the obtaining, by theterminal, first illumination information corresponding to the first gridvertex information according to a preset color setting rule and thesecond normal information comprises: storing, by the terminal, accordingto the second normal information and the preset color setting rule,color information on each grid vertex of the first grid vertexinformation to obtain second color information of the first grid vertexinformation and using the second color information as the firstillumination information.
 18. The non-transitory computer readablestorage medium according to claim 17, wherein the rendering, by theterminal, the first virtual object model by using the first illuminationinformation, the first color information, and the first grid vertexinformation to obtain a second virtual object model comprises:performing, by the terminal, interpolation on the first colorinformation and the second color information corresponding to the firstgrid vertex information to obtain main vertex color information of eachgrid vertex corresponding to the first grid vertex information; anddrawing, by the terminal, according to a correspondence between the mainvertex color information and each grid vertex to obtain the secondvirtual object model.
 19. The non-transitory computer readable storagemedium according to claim 15, wherein the plurality of operationsfurther comprise: before the obtaining, by the terminal, first gridvertex information of a preset first virtual object model: obtaining, bythe terminal, second grid vertex information corresponding to the thirdvirtual object model, the third virtual object model being thehigh-precision model corresponding to the preset first virtual objectmodel; obtaining, by the terminal, a first normal direction according tothe second grid vertex information and a preset normal model; anddetermining, by the terminal, the first normal information correspondingto the first normal direction according to a correspondence between thesecond grid vertex information and a first grid vertex.
 20. Thenon-transitory computer readable storage medium according to claim 15,wherein the plurality of operations further comprise: before theobtaining, by the terminal, first grid vertex information of a presetfirst virtual object model, obtaining, by the terminal, a scene file andestablishing a first scene according to the scene file.